package com.itheima.nio.tomcat.process;

import com.itheima.nio.tomcat.domain.HttpRequest;
import com.itheima.nio.tomcat.domain.HttpResponse;
import com.itheima.nio.tomcat.servlet.AServlet;
import com.itheima.nio.tomcat.servlet.UserServlet;

public class DynamicResourceProcess {

    public void process(HttpRequest httpRequest, HttpResponse httpResponse){
        String requestURI = httpRequest.getRequestURI();
        if (requestURI.endsWith("userServlet")){
            UserServlet userServlet = new UserServlet();
            userServlet.service(httpRequest, httpResponse);
        } else if (requestURI.endsWith("AServlet")){
            AServlet aServlet = new AServlet();
            aServlet.service(httpRequest,httpResponse);
        }
        
    }
}
